home *** CD-ROM | disk | FTP | other *** search
/ SIGGRAPH 1997: Visual Proceedings / SIGGRAPH 1997: Visual Proceedings - Disc 2.iso / pc / contents / sketches / technic / ibrahim / abstract.mac < prev    next >
Text File  |  1997-07-05  |  4KB  |  113 lines

  1. Genetic Shaders: Interactive and Automatic Shader Generation
  2.  
  3. Aladin M. Ibrahim and Donald H. House
  4.  
  5. Visualization Laboratory
  6. 216 Langford Center
  7. Texas A&M University
  8. College Station, TX 77843
  9. (409)845-3465
  10. (409)845-4491 (Fax)
  11. aladin@viz.tamu.edu
  12. house@viz.tamu.edu
  13.  
  14. Contact author:
  15. Aladin M. Ibrahim
  16.  
  17.  
  18.  
  19.  
  20. Genetic Shaders: Interactive and Automatic Shader Generation
  21.  
  22.  
  23. Summary
  24.  
  25. This sketch presents a system that generates procedural textures or
  26. shaders using genetic algorithm techniques. The system operates in
  27. both artist directed and automatic texture matching modes.
  28.  
  29.  
  30. Genetic Shaders: Interactive and Automatic Shader Generation
  31.  
  32. Introduction
  33.  
  34. Realistic image generation in computer graphics is greatly facilitated
  35. by either using texture mapping of real images or writing shaders,
  36. programs that procedurally describe textures. Using texture mapping,
  37. e.g. scanning a photograph, is rarely adequate as the photograph may
  38. capture information about the lighting direction and may cause
  39. aliasing problems. Another problem with a scanned texture image is
  40. that it has a finite size and resolution, and tiling the texture
  41. across a surface may cause unnatural periodicity. Writing shaders
  42. might seem to be a powerful approach, however in practice it is often
  43. very difficult to achieve desired look.
  44.  
  45. This sketch presents a system that generates procedural textures or
  46. shaders using genetic algorithm techniques. The system operates in
  47. both artist directed and automatic texture matching modes. In
  48. interactive artist directed mode, aesthetic evaluation and selection
  49. is controlled by the user.  In automatic mode, the system compares
  50. rendered images of generated shaders to images of target textures,
  51. using texture matching techniques.
  52.  
  53. Representation
  54.  
  55. In our system, a shader is a hierarchical directed acylic graph of
  56. nodes, where each node represents a predefined function or texture.
  57.  
  58. Initial Selection
  59.  
  60. An initial population of shaders is obtained by searching through a
  61. predefined library of shaders, testing these images from the shaders
  62. against the target texture and scoring the images. The system selects
  63. the initial population from those receiving the best scores. Selection
  64. in the interactive mode is similar but based on the users' aesthetic
  65. judgment.
  66.  
  67. Breeding and Ongoing Evaluation
  68.  
  69. "Parent" shaders are selected and bred to create new children for the
  70. ongoing population. When breeding two hierarchies of shaders, the
  71. breeding procedure selects a random node in each hierarchy and swaps
  72. the subtrees under these nodes. The system evaluates images of
  73. generated shaders in the automatic mode, while in interactive mode
  74. users assign scores to images of shaders based on their aesthetic
  75. judgment.
  76.  
  77. The new population of shaders is determined based on this fitness
  78. evaluation. A genetic algorithm procedure is used to determine which
  79. shaders will survive and reproduce and which will die, based on this
  80. fitness.  Shaders are shuffled and each pair of shaders is selected to
  81. breed. After a new population is generated, using the interactive
  82. mode, users repeat previous steps to generate a new population and so
  83. on until satisfied with the result. In the automatic mode, the
  84. generation continues until a generated shader is sufficiently close to
  85. the target texture or a maximum number of generations has been
  86. reached.
  87.  
  88. Mutation
  89.  
  90. Random mutation is used to introduce diversity into the
  91. population. After breeding, the hierarchy is traversed, leaf node
  92. input variables are randomly selected, and depending on the mutation
  93. rate, changed to other valid values.
  94.  
  95. User Interface and Operation
  96.  
  97. The figure accompanying this text shows the system as it appears to the
  98. user, and a collection of generated shaders.  The top row of the
  99. interface contains generation parameters while the middle three rows
  100. contain rendered images of the current population of shaders. On the
  101. bottom row are images of temporarily stored shaders.
  102.  
  103. The interactive mode has been used to generate a variety of complex
  104. shaders including both surface and displacement shaders, such as those
  105. shown in the figure.  When running in interactive mode, the user
  106. selects two parents for breeding and the top two images on the
  107. interface show the currently selected parents.  On the other hand, in
  108. automatic mode, the top two images show the target texture, and the
  109. middle three rows show images of shaders that are attempts to match
  110. the target shader.  In this case, parent selection and breeding takes
  111. place automatically.
  112.  
  113.